package com.pet.pet04item.service;

import com.pet.pet04item.feign.RemoteUserService;
import com.pet.pojo.Item;
import com.pet.pojo.User;
import com.pet.service.BuyService;
import com.pet.service.ItemService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class BuyServiceImpl implements BuyService {
    @Autowired
    private RemoteUserService remoteUserService;
    @Autowired
    private ItemService itemService;
    @Override
    public User getUser(String userName) {
        User user = remoteUserService.getUserByName(userName);
        return user;
    }

    @Override
    public Item getItem(Integer itemId) {
        Item item = itemService.getItemById(itemId);
        return item;
    }
}
